home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14359 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.7 KB  |  56 lines

  1. Newsgroups: comp.lang.c
  2. Path: news.uunet.ca!wildcan!sq!msb
  3. From: msb@sq.com (Mark Brader)
  4. Subject: Character set history (was: Recursion)
  5. Message-ID: <1996Apr13.230051.21741@sq.com>
  6. Organization: SoftQuad Inc., Toronto, Canada
  7. References: <31624BC2.70D2@sooner.net> <4kmm8f$ibd@sun001.spd.dsccc.com> <4kmsg0INNln0@keats.ugrad.cs.ubc.ca> <4knhci$67t@solutions.solon.com>
  8. Date: Sat, 13 Apr 1996 23:00:51 GMT
  9.  
  10. Kazimir Kylheku <c2a192@ugrad.cs.ubc.ca> writes:
  11. > > Do you know any character sets in which the digit characters don't
  12. > > collate in sequence from '0' to '9'?
  13.  
  14. Peter Seebach (seebs@solon.com) answers:
  15. > Doesn't matter; ANSI specifically requires that they do, and that they
  16. > are adjacent.  Presumably for precisely this reason.
  17.  
  18. "ANSI" here means the C standard, and indeed, I believe it's always
  19. been true for the character sets of machines where C has been implemented.
  20. If someone ever implements C on a machine whose native character set doesn't
  21. meet that requirement, they will have to do some sort of transliteration
  22. or emulation to make it look as though it does.
  23.  
  24.  
  25. To digress outside of the newsgroup's scope, though, there certainly
  26. have been character sets historically where the 10 characters
  27. "0123456789" did not occupy consecutive positions in that order.
  28.  
  29. [1] The sequence " 1234567890" occurred in BCDIC (the code that EBCDIC
  30.     was nominally an "Extended" version of), and in something called PTTC.
  31.     These were 6-bit character sets used in punch-card days.  Thus '8'-'2'
  32.     would be 6 as in ASCII or EBCDIC, but '8'-'0' would be -2, not 8.
  33.  
  34. [2] On the IBM 7030 or Stretch computer, the digits 0 to 9 occurred in
  35.     order but in consecutive *even* positions in the character set.  That
  36.     is, '8'-'2' would be 12, and '8'-'0' would be 16.  The odd positions
  37.     were used for subscripts: '8'+1 was a subscript 8.
  38.  
  39. [3] In the days of real Teletypes and paper tape, there were 5-bit
  40.     character sets.  I have a table of one of these, CCITT #2.  Its
  41.     sequence of characters looks completely random; the digits are
  42.     scattered all over the place, though always in the same shift
  43.     state.  I presume the code was based somehow in the internal
  44.     arrangements of a particular, common model of Teletype.  For
  45.     example, '8'-'2' would have been -13 and '8'-'0' would be -1.
  46.  
  47. The source for this information is a book specifically about the
  48. history of computer character sets, which I had out of the library
  49. once but don't seem to have kept a record of the title of.  I imagine
  50. that CCITT #2, at least, is still in use in a few odd places.
  51. -- 
  52. Mark Brader, msb@sq.com         "But I do't have a '' key o my termial."
  53. SoftQuad Inc., Toronto                                     -- Lynn Gold
  54.  
  55. My text in this article is in the public domain.
  56.